package cn.highedu.spring;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration // 声明这是一个管理类
@ComponentScan("cn.highedu.spring") // 声明到哪些包下扫描注解(@Component、@Service、@Controller、@Repository、@Bean)
public class ContextConfig {

    // 为ArrayList集合类的对象如何加上初始化和销毁方法
    //@Bean(initMethod = "init", destroyMethod = "destroy") // 把ThirdPartyClass类的对象交给Spring容器管理 标识(id)是方法名(thirdPartyClass)
    public ThirdPartyClass thirdPartyClass() {
        return new ThirdPartyClass();
    }
}
